/**
 * @author levinhuang
 * ����ͼ���ͳ�ƴ���
 */
;(function($){
	$(function(){
		var trackUrl = "http://track2.svip.sohu.com/track/empty.js" ,$items = $("[data-track]") ,_ts = new Date().getTime();
		var scriptId = '_mdcfocus_script_' + _ts;
		if($items.length>0){
			$items.each(function(i,o){
				o=$(o);
				(function($t,j){
					$t.click(function(){
						var data = [];
						data.push('id=' + $t.attr("data-track"));
						data.push('index=' + $t.attr("data-track-index"));
						if($t.data("curData") && $t.data("curData").l){
							data.push('url=' + encodeURIComponent($t.data("curData").l));
						}else if($t.attr("data-track-url")){
							data.push('url=' + encodeURIComponent($t.attr("data-track-url")));
						}else{
							data.push('url=' + encodeURIComponent('nourl'));
						}
						data.push('ts=' + new Date().getTime());

						var scriptObj = document.getElementById(scriptId);
						var head = document.getElementsByTagName('head')[0];
						head = head || document.body;

						if(scriptObj){
							head.removeChild(scriptObj);
						}
						scriptObj = null;
						scriptObj = document.createElement('script');
						scriptObj.id = scriptId;
						scriptObj.src = trackUrl+"?"+data.join('&');
						head.appendChild(scriptObj);
					});					
				})(o,i);

			});			
		};

	});	
})(jQuery);
